package com.lmt.controller;

import com.lmt.common.entity.Result;
import com.lmt.common.util.ResultUtil;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/role")
public class RoleController {


    @RequestMapping("/superAdmin")
    @RequiresRoles("superAdmin")
    public Result superAdmin() {
        return ResultUtil.success("/role/superAdmin");
    }

    @RequestMapping("/shiroConfiguration")
    public Result shiroConfiguration() {
        return ResultUtil.success("/role/shiroConfiguration ---> /role/superAdmin");
    }

    @RequestMapping("/admin")
    @RequiresRoles("admin")
    public Result admin() {
        return ResultUtil.success("/role/admin");
    }

    @RequestMapping("/user")
    @RequiresRoles("user")
    public Result user() {
        return ResultUtil.success("/role/user");
    }

    @RequestMapping("/anyRole")
    public Result anyRole() {
        return ResultUtil.success("/role/anyRole ---> admin Or superAdmin");
    }

}
